from django.contrib import admin

from myapp.models import Book


# Register your models here.
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
    fields = ['no', 'name', 'author']
    list_display = ['no', 'name', 'author', 'created_at']
    search_fields = ['no', 'name']
    list_filter = ['author', 'created_at']
    list_per_page = 10

    admin.site.site_header = 'ISEE小栈管理后台'  # 设置header
    admin.site.site_title = 'ISEE小栈管理后台'  # 设置title